﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class RemisionesFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As RemisionesBE
        Dim tmpRemisiones As RemisionesBE = New RemisionesBE()
        Try
            With tmpRemisiones
                .CondicionesPago = convertDTFromDb.ConvertString(dr.Item("CondicionesPago"))
                .Descuentos = convertDTFromDb.convertDouble(dr.Item("Descuentos"))
                .DescuentosAdic = convertDTFromDb.convertDouble(dr.Item("DescuentosAdic"))
                .Emite = convertDTFromDb.ConvertString(dr.Item("Emite"))
                .Fecha = convertDTFromDb.convertDateTime(dr.Item("Fecha"))
                .FecVen = convertDTFromDb.convertDateTime(dr.Item("FecVen"))
                .FormaPago = convertDTFromDb.ConvertString(dr.Item("FormaPago"))
                .FormaPago2 = convertDTFromDb.ConvertString(dr.Item("FormaPago2"))
                .Genero = convertDTFromDb.ConvertString(dr.Item("Genero"))
                .IdCliente = convertDTFromDb.ConvertString(dr.Item("IdCliente"))
                .IdVendedor = convertDTFromDb.ConvertLong(dr.Item("IdVendedor"))
                .IEPS = convertDTFromDb.convertDouble(dr.Item("IEPS"))
                .Importe1 = convertDTFromDb.convertDouble(dr.Item("Importe1"))
                .IVA = convertDTFromDb.convertDouble(dr.Item("IVA"))
                .Leyenda1 = convertDTFromDb.ConvertString(dr.Item("Leyenda1"))
                .MetodoPago = convertDTFromDb.ConvertString(dr.Item("MetodoPago"))
                .Moneda = convertDTFromDb.ConvertString(dr.Item("Moneda"))
                .MotivoDesc = convertDTFromDb.ConvertString(dr.Item("MotivoDesc"))
                .Numero = convertDTFromDb.ConvertLong(dr.Item("Numero"))
                .NumPed = convertDTFromDb.ConvertLong(dr.Item("NumPed"))
                .NumRem = convertDTFromDb.ConvertLong(dr.Item("NumRem"))
                .Observaciones = convertDTFromDb.ConvertString(dr.Item("Observaciones"))
                .Origen = convertDTFromDb.ConvertString(dr.Item("Origen"))
                .PorcRetISR = convertDTFromDb.convertDouble(dr.Item("PorcRetISR"))
                .PorcRetIVA = convertDTFromDb.convertDouble(dr.Item("PorcRetIVA"))
                .RetISR = convertDTFromDb.convertDouble(dr.Item("RetISR"))
                .RetIVA = convertDTFromDb.convertDouble(dr.Item("RetIVA"))
                .Saldo = convertDTFromDb.convertDouble(dr.Item("Saldo"))
                .Status = convertDTFromDb.ConvertString(dr.Item("Status"))
                .Subtotal1 = convertDTFromDb.convertDouble(dr.Item("Subtotal1"))
                .Subtotal2 = convertDTFromDb.convertDouble(dr.Item("Subtotal2"))
                .TipoCambio = convertDTFromDb.convertDouble(dr.Item("TipoCambio"))
                .Total = convertDTFromDb.convertDouble(dr.Item("Total"))
            End With
            Return tmpRemisiones
        Catch ex As Exception
            Throw
        Finally
            tmpRemisiones = Nothing
        End Try
    End Function
End Class
